#pragma once

class XgW32Process;

#include "XgW32ProcessModules.h"
#include "tstring.h"
#include <windows.h>

class XgW32Process
{
public:
	XgW32Process();
	XgW32Process(DWORD pid);
	XgW32Process(const XgW32Process& proc);

public:
	~XgW32Process(void);

public:
	bool openProcess();
	bool closeHandle();

public:
	DWORD enumModules(HMODULE* aModules, DWORD size);

public:
	XgW32ProcessModules getModules();
	TSTRING getModuleName(HMODULE hMod);
	TSTRING getModulePath(HMODULE hMod);

public:
	bool inject();

public:
	TSTRING name();
	DWORD pid();

public:
	inline operator DWORD() const
	{
		return _pid;
	}

private:
	DWORD _pid;
	HANDLE _hProcess;
};